## Pre-Shared Key (to be used before auth is totally baked in...
psk = "H6QB4Z57LHX2MNJS"

## Program descr
description='''pdrive tools!

pdrive [superCommnad] [subCommand] [options...]

Super Commands:
  init
  media
  tag
  s3
  dbase
  view
  server
  image
  video

init: Sets up config file and database; run this first or if you want to delete/create a database

server: Starts a pdrive httpd server (expects --port)

Sub Commands for 'media'
  import        import media into the repo (optionally, --localdir [dir])
  ls            lists all media (optionaly, one or more --tag [tag] to limit results match; optionally, --mediatype [type], --search [string], optional --showrate and/or --showdescr to show rating/description, optionally --filetype [filetype])
  details       print details related to the media (expects --hash)
  lsmediatypes  lists all media types
  lsfiletypes   list all file types
  pathto        print the fqpn related to a hash (expects --hash)
  addtag        adds a tag to a hash (expects --hash and --tag)
  rmtag         removes a tag from a hash (expects --hash and --tag)
  export        create links to (or copies of) repo files (expects --localdir. --hash for only one file. optionaly, one or more --tag [tag] to limit results match. optinally, --search [string]. optinally, --hard. optionally, --copy. optionally, --onedir)
  rm            remove media from repo (expects --hash; optionally --s3 to remove from s3)
  checkrepo     compare dbase to repo
  rate          get/set rating (optionally, --rate [1 - 5] to set rate)
  descr         get/set description (optinally, --descr [string] to set description)

Sub Commands for 'tag'
  ls  list all tags and use counts
  add add a tag (expects --tag)
  rm  delete a tag (expects --tag and/or --id)

Sub Commands for 's3'
  sync   if needed, sync files to s3
  geturl get a time expire url to a file sync'ed to S3 (expects --hash and optional --seconds)
  setup  setups up/reconfigure s3 + pdrive integration

Sub Commands for 'dbase'
  getvalue  Get the value of a key (expects --configkey)
  setvalue  Set the value of a key (expects --configkey and --configvalue/--settrue/--setfalse)

Sub Commands for 'image'
  mkthumbs  make thumbnail images from images in repo
  rmthumbs  remove all thumbnails from repo
  
Sub Commands for 'video'
  mkthumbs  make thumbnail images from videos in repo
  rmthumbs  remove all thumbnails from repo
'''

